<script lang="ts" setup>
import { Delete } from '@element-plus/icons-vue';
import { ElMessageBox } from 'element-plus';
import { $t } from '@/plugins/i18n/index';
import { Emits, props } from '../props';
const { selectIds } = defineProps(props);
const emit = defineEmits<Emits>();
const deleteBatchChange = (ids: Array<any>) => {
    if (ids.length > 0) {
        ElMessageBox.confirm($t(`title.confirmSelectDelete`), $t(`title.warning`), {
            confirmButtonText: $t(`button.confirm`),
            cancelButtonText: $t(`button.cancel`),
            type: 'warning'
        }).then(() => {
            //确认回调
            emit('deleteBatchChange', ids);
        });
    }
};
</script>
<template>
    <el-button type="danger" :icon="Delete" @click.stop.prevent="deleteBatchChange(selectIds)">{{ $t(`button.deleteBatch`) }}</el-button>
</template>
